package com.tqfframe.rabbitmq.listener.direct;

import com.tqfframe.rabbitmq.constants.RabbitConstants;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * 普通消息队列监听方式3
 * @author: Qifeng Tang
 * @date: 2022/11/14 11:36
 * @Version 1.0
 **/

@Component
public class CommonReceiver3 {

    @RabbitListener(queues = (RabbitConstants.COMMON_QUEUE))        // queues需手动先创建队列。需要搭配注入。
    public void receive(String in) {
        System.out.println("我是普通消息，我消费了"+in);
    }

}
